package dreic;


/**
 * This class defines all binary operators of zwei.
 */
object Operators extends Enumeration {
  type Operator = Value;
  
  // binary
  val ADD = Value("+");
  val SUB = Value("-");
  val MUL = Value("*");
  val DIV = Value("/");
  val MOD = Value("%");
  val EQ  = Value("==");
  val NE  = Value("!=");
  val LT  = Value("<");
  val LE  = Value("<=");
  val GT  = Value(">");
  val GE  = Value(">=");
  val AND = Value("&&");
  
  // unary
  val NEG = Value("-");
  val NOT = Value("!");

  import scala.collection.mutable.HashMap;

  val token2op = new HashMap[Tokens.Token, Operator]();

  token2op += Tokens.PLUS -> ADD;
  token2op += Tokens.MOINS -> SUB;
  token2op += Tokens.PROD -> MUL;
  token2op += Tokens.QUOT -> DIV;
  token2op += Tokens.PERCENT -> MOD;
  token2op += Tokens.EGAL  -> EQ;
  token2op += Tokens.NEGAL  -> NE;
  token2op += Tokens.PETIT  -> LT;
  token2op += Tokens.PTOUEG  -> LE;
  token2op += Tokens.GRAND  -> GT;
  token2op += Tokens.GROUEG  -> GE;
  token2op += Tokens.AND -> AND;
  token2op += Tokens.NEG -> NOT;
}
